package com.learn.training.multithread.chapter6.minchapter10.demo1;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        IdGenerator idGenerator = new IdGenerator();
        for (int i = 0; i < 10; i++) {
            Thread t = new Thread(() -> {
                System.out.println(Thread.currentThread().getName() + "   " + idGenerator.getNextId());
            });
            t.start();
        }
    }
}
